package Book;

/**
 * Description:
 * Date: 2025-10-18
 * Time: 17:03
 */
public class Book {
    private String name;//书名
    private String author;//作者
    private String type;//类型
    private double price;//价格
    boolean isBorrow;//判断书籍是否被借出

    //构造方法实现书的初始化
    public Book(String name, String author, String type, double price) {
        this.name = name;
        this.author = author;
        this.type = type;
        this.price = price;
    }

    @Override
    public String toString() {
        return "Book{" +
                "name='" + name + '\'' +
                ", author='" + author + '\'' +
                ", type='" + type + '\'' +
                ", price=" + price +
                ", " + (isBorrow == true? "已借出":"未借出") +
                '}';
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Boolean getisBorrow() {
        return isBorrow;
    }

    public void setisBorrow(boolean isBorrow) {
        this.isBorrow = isBorrow;
    }
}
